/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mireille.learning.devoir1.utility;

import mireille.learning.devoir1.Exceptions.CompteException;

/**
 *
 * @author Luca
 */
public class GestionBancaireUtility {

    public static boolean isStringNumeric(String name) throws CompteException {
        try {
            Double.parseDouble(name);
            return true;
        } catch (NumberFormatException ex) {
            throw new CompteException("INSERIRE MESSAGGIO DI ERRORE !!!");
        }
    }

    public static boolean isStringContainsNumber(String name) {
        if (name.contains("1")
                || name.contains("2")
                || name.contains("3")
                || name.contains("4")
                || name.contains("5")
                || name.contains("6")
                || name.contains("7")
                || name.contains("8")
                || name.contains("9")
                || name.contains("0")) {
            return true;
        } else {
            return false;
        }
    }
}
